xen/arm: traps: Avoid unnecessary VA -> IPA translation in abort handlers
authorJulien Grall <julien.grall@arm.com>
Thu, 4 Aug 2016 17:50:06 +0000 (18:50 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Thu, 4 Aug 2016 17:56:32 +0000 (10:56 -0700)
commit4b3b430fcb09823177fc44e96901458ac5a399de
treee82a95cc156a6481b03dd73d91fe01c6fde569d7
parentdef427387f37cec21a68f280d8964d1f0d61fb74
xen/arm: traps: Avoid unnecessary VA -> IPA translation in abort handlers

Translating a VA to a IPA is expensive. Currently, Xen is assuming that
HPFAR_EL2 is only valid when the stage-2 data/instruction abort happened
during a translation table walk of a first stage translation (i.e S1PTW
is set).

However, based on the ARM ARM (D7.2.34 in DDI 0487A.j), the register is
also valid when the data/instruction abort occured for a translation
fault.

With this change, the VA -> IPA translation will only happen for
permission faults that are not related to a translation table of a
first stage translation.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/traps.c